﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using SWCInvoice.Enums;

namespace SWCInvoice.Utils.Bindingconverter {
    public class MessageTypToImage : IValueConverter {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            string filename = "";
            try {
                MessageTyp x = (MessageTyp)value;
                if (x == MessageTyp.Error) {
                    filename = @"..\icons\gui\error.png";
                } else if (x == MessageTyp.Warning) {
                    filename = @"..\icons\gui\warning.png";
                } else if (x == MessageTyp.Information) {
                    filename = @"..\icons\gui\information.png";
                } else if (x == MessageTyp.None) {
                    filename = "";
                }
            } catch (Exception) {
            }
            return filename;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            return value;
        }
    }
}
